package com.hello.system.service.impl;

import java.util.List;
import com.hello.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hello.system.mapper.CommentLikesMapper;
import com.hello.system.domain.CommentLikes;
import com.hello.system.service.ICommentLikesService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * 评论点赞记录Service业务层处理
 * 
 * @author hello
 * @date 2025-10-29
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class CommentLikesServiceImpl extends ServiceImpl<CommentLikesMapper, CommentLikes> implements ICommentLikesService 
{
    private final CommentLikesMapper commentLikesMapper;

    /**
     * 查询评论点赞记录
     * 
     * @param likeId 评论点赞记录主键
     * @return 评论点赞记录
     */
    @Override
    public CommentLikes selectCommentLikesByLikeId(Long likeId)
    {
        return commentLikesMapper.selectCommentLikesByLikeId(likeId);
    }

    /**
     * 查询评论点赞记录列表
     * 
     * @param commentLikes 评论点赞记录
     * @return 评论点赞记录
     */
    @Override
    public List<CommentLikes> selectCommentLikesList(CommentLikes commentLikes)
    {
        return commentLikesMapper.selectCommentLikesList(commentLikes);
    }

    /**
     * 新增评论点赞记录
     * 
     * @param commentLikes 评论点赞记录
     * @return 结果
     */
    @Override
    public int insertCommentLikes(CommentLikes commentLikes)
    {
        commentLikes.setCreateTime(DateUtils.getNowDate());
        return commentLikesMapper.insertCommentLikes(commentLikes);
    }

    /**
     * 修改评论点赞记录
     * 
     * @param commentLikes 评论点赞记录
     * @return 结果
     */
    @Override
    public int updateCommentLikes(CommentLikes commentLikes)
    {
        commentLikes.setUpdateTime(DateUtils.getNowDate());
        return commentLikesMapper.updateCommentLikes(commentLikes);
    }


    /**
     * 批量删除评论点赞记录
     * 
     * @param likeIds 需要删除的评论点赞记录主键
     * @return 结果
     */
    @Override
    public int deleteCommentLikesByLikeIds(Long[] likeIds)
    {
        return commentLikesMapper.deleteCommentLikesByLikeIds(likeIds);
    }

    /**
     * 删除评论点赞记录信息
     * 
     * @param likeId 评论点赞记录主键
     * @return 结果
     */
    @Override
    public int deleteCommentLikesByLikeId(Long likeId)
    {
        return commentLikesMapper.deleteCommentLikesByLikeId(likeId);
    }
}
